<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ page import="java.sql.*" %> 
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<%
//加载驱动
Class.forName("org.mariadb.jdbc.Driver");
//建立与数据库连接
Connection connection=DriverManager.getConnection("jdbc:mariadb://10.220.140.102:3366/studb11","stua","zHZUA65r");
//创建语句集
Statement stmt=connection.createStatement();
//结果查询
ResultSet rs = stmt. executeQuery("select*from jiudian1");
//显示RS结果
out.println("<table width='100%' border='1'>");
out.println("<tr><th>id:</th><th>用户姓名:</th><th>电话号码:</th><th>入店信息:</th><th>离店信息:</th><th>备注</th><th>操作</th></tr>");
while (rs.next()){
	out.println("<tr>");
	out.println("<td>"+rs.getString("id")+"</td>");
	out.println("<td>"+rs.getString("name")+"</td>");
	out.println("<td>"+rs.getString("phone")+"</td>");
	out.println("<td>"+rs.getString("indate")+"</td>");
	out.println("<td>"+rs.getString("outdate")+"</td>");
	out.println("<td>"+rs.getString("remarks")+"</td>");
	out.println("<td> <a href='delhotel1-details.jsp?id=" + rs.getString("id")+"'>del</a></td>");
	out.println("</tr>");
}
out.println("</table>");
rs.close();
stmt.close();
connection.close();
%>


</body>
</html>